from DEAD.AutoDecoder.Generator.Generator import generate_grain_from_stl_and_txt
from multiprocessing import Pool

def process_grain(i):
    # 训练集
    generate_grain_from_stl_and_txt(i, "/media/hpc/Backup_lwt/3DModel/G47800-V1.1", "Share/G47800/Data/Grain/Train", 10000, False)
    # 测试集
    generate_grain_from_stl_and_txt(i, "/media/hpc/Backup_lwt/3DModel/G47800-V1.1", "Share/G47800/Data/Grain/Test", 1000, False)

if __name__ == '__main__':
    # 使用多进程池
    with Pool(processes=3) as pool:
        pool.map(process_grain, range(0, 47800))